#ifndef OBSTACLE_H
#define OBSTACLE_H
#include<QPixmap>
#include<QTimer>
#include<QRect>
class obstacle
{
private:
    int x,y;
    int width,height;
public:
  //  explicit Barriers(QWidget *parent = nullptr);
    obstacle(int x,int y,int width,int height);
    int getX();
    int getY();
    void setX(int x);
    void setY(int y);
    int getWidth();
    int getHeight();
};
class Wall:public obstacle
{
private:
    QPixmap img;
public:
    int speed;
    Wall(int x,int y,int width,int height);
    QPixmap getImg();
    bool isCollision(int y);
    void move();  //障碍移动
    bool done();  //障碍是否已过去
};
#endif // OBSTACLE_H
